package 基础语法.常用API;

import java.io.IOException;

public class RuntimeLearn {
    public static void main(String[] args) throws IOException {
        Runtime runtime=Runtime.getRuntime();
        System.out.println(runtime.availableProcessors());//cpu线程数
        System.out.println(runtime.maxMemory()/1024/1024+"MB");//byte
        System.out.println(runtime.freeMemory()/1024/1024+"Mb");
        System.out.println(runtime.totalMemory()/1024/1024+"Mb");
        runtime.exec("notepad");//执行CMD命令
        
       runtime.exit(0);
    }
    
}
